<?php
$view = $this;
$view->headTitle(' - Admin');

// carrega os css
$view->headLink()->appendStylesheet($this->baseUrl('_css/reset.css'));
$view->headLink()->appendStylesheet($this->baseUrl('_css/style.css'));
$view->headLink()->appendStylesheet($this->baseUrl('_css/red.css'));
$view->headLink()->appendStylesheet($this->baseUrl('_css/invalid.css'));
$view->headLink()->appendStylesheet($this->baseUrl('_css/ie.css'), 'screen', 'lte IE 7');

// carrega os js
$view->headScript()->prependScript(
	"DD_belatedPNG.fix('.png_bg, img, li');",
	'text/javascript',
	array('conditional' => 'lt IE 6')
);
$view->headScript()->prependFile(
	$this->baseUrl('_js/DD_belatedPNG_0.0.7a.js'),
	'text/javascript',
	array('conditional' => 'lt IE 6')
);
$view->headScript()->prependFile($this->baseUrl('_js/jquery.wysiwyg.js'));
$view->headScript()->prependFile($this->baseUrl('_js/facebox.js'));
$view->headScript()->prependFile($this->baseUrl('_js/simpla.jquery.configuration.js'));
$view->headScript()->prependFile($this->baseUrl('_js/jquery-1.6.min.js'));

$usuario = $this->layout()->identity;

// função para ativar o link
$request = Zend_Controller_Front::getInstance()->getRequest();
global $controlador;
$controlador = $request->getControllerName();
function checaSecao($secao){
	global $controlador;
	echo (in_array($controlador, (array)$secao)) ? 'current' : '';
}
?>
<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml">
 
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	    <?php echo $this->headTitle() ?>
	    <?php echo $this->headLink() ?>
	    <?php echo $this->headStyle() ?>
	    <?php echo $this->headScript() ?>		
	</head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		
		<div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu -->
			
			<h1 id="sidebar-title"><a href="<?php echo $this->baseUrl('admin'); ?>">Simpla Admin</a></h1>
		  
			<!-- Logo (221px wide) -->
			<a href="<?php echo $this->baseUrl('admin'); ?>"><img id="logo" width="200" src="<?php echo $this->baseUrl('_img/site/logo-grande.png'); ?>" alt="Simpla Admin logo" /></a>
		  
			<!-- Sidebar Profile links -->
			<div id="profile-links">
				<a href="<?php echo $this->baseUrl(); ?>" title="Ir para o site">Ir para o site</a> | 
				<a href="<?php echo $this->baseUrl('admin/perfil'); ?>" title="Editar perfil">Editar perfil</a> | 
				<a href="<?php echo $this->baseUrl('admin/login/sai'); ?>" title="Sair">Sair</a>
			</div>        
			
			<ul id="main-nav">  <!-- Accordion Menu -->
				
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('usuarios', 'newsletters')); ?>">
						Geral
					</a>
					<ul>
						<li><a class="<?php checaSecao('usuarios'); ?>" href="<?php echo $this->baseUrl('admin/usuarios'); ?>">Gerenciar Usuários</a></li>
						<li><a class="<?php checaSecao('newsletters'); ?>" href="<?php echo $this->baseUrl('admin/newsletters'); ?>">Visualizar Usuários Cadastrados nas Newsletters</a></li>
					</ul>
				</li>
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('banners')); ?>">
						Banners
					</a>
					<ul>
						<li><a class="<?php checaSecao('banners');?>" href="<?php echo $this->baseUrl('admin/banners'); ?>">Gerenciar Banners</a></li>
					</ul>
				</li>
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('produtos', 'produtos-categorias')); ?>">
						Produtos
					</a>
					<ul>
						<li><a class="<?php checaSecao('produtos-categorias');?>" href="<?php echo $this->baseUrl('admin/produtos-categorias'); ?>">Gerenciar Categoria dos Produtos</a></li>
						<li><a class="<?php checaSecao('produtos');?>" href="<?php echo $this->baseUrl('admin/produtos'); ?>">Gerenciar Produtos</a></li>
					</ul>
				</li>
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('distribuidores')); ?>">
						Distribuidores
					</a>
					<ul>
						<li><a class="<?php checaSecao('distribuidores');?>" href="<?php echo $this->baseUrl('admin/distribuidores'); ?>">Gerenciar Distribuidores</a></li>
					</ul>
				</li>
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('onde-encontrar')); ?>">
						Onde encontrar
					</a>
					<ul>
						<li><a class="<?php checaSecao('onde-encontrar');?>" href="<?php echo $this->baseUrl('admin/onde-encontrar'); ?>">Gerenciar Endereços</a></li>
					</ul>
				</li>
				<li> 
					<a href="#" class="nav-top-item <?php checaSecao(array('receitas')); ?>">
						Receitas
					</a>
					<ul>
						<li><a class="<?php checaSecao('receitas');?>" href="<?php echo $this->baseUrl('admin/receitas'); ?>">Gerenciar Receitas</a></li>
					</ul>
				</li>
				
			</ul> <!-- End #main-nav -->
			
		</div></div> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<noscript> <!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
					</div>
				</div>
			</noscript>
			
			<!-- Page Head -->
			<h2>Bem-vindo, <?php echo @$usuario->nome; ?></h2>
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				<?php echo $this->layout()->content; ?>
			</div> <!-- End .content-box -->
			<div class="clear"></div>
			
			<div id="footer">
				<small>
						&#169; Copyright 2012 Simpla Admin | Powered by <a href="http://themeforest.net/item/simpla-admin-flexible-user-friendly-admin-skin/46073">Simpla Admin</a> | <a href="#">Top</a>
				</small>
			</div><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  
</html>
